package com.bdqn.demo.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;

/**
 * FilterConfig
 *
 * @author f
 * @since 2021/11/30
 */
public class FilterConfig {
    /**
     * 配置过滤规则
     */
    // @Bean
    public FilterRegistrationBean filterRegist() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        // registration.setFilter(new AuthorizationFilter());
        registration.setName("AuthorizationFilter");
        registration.addUrlPatterns("/main"); // 作为演示，仅仅只限制/main访问
        registration.setOrder(5);
        return registration;
    }
}
